const Mock = require('mockjs');
const data = Mock.mock(() => {
	return new Array(200).fill().map(() => {
		const num = Mock.Random.integer(1, 3);
		let item = null
		switch (num) {
			case 1:
				item = Mock.mock({
					"images|3": ["@image(100x80, @color, image)"],
				})
				break;
			case 2:
				item = Mock.mock({
					rightImg: '@image(100x100, @color, rightImg)',
				})
				break;
			case 3:
				item = Mock.mock({
					vedio: '@image(100x100, @color, rightImg)',
				})
				break;
		}

		return Mock.mock({
			...item,
			title: '@ctitle',
			id: '@id',
			desc: '@cword(20, 30)',
			createDate: '@date',
			"banner|4": ['@image(120x80, @color, img)'],
			"subList|2-5": [{
				title: '@ctitle',
				price: '@integer(10000, 500000)',
				desc: '@cword(10, 20)',
				id: '@id'
			}],
			descImg: {
				"face|10-100": ['@image(100x100, @color)'],
				"trim|10-100": ['@image(100x100, @color)'],
				"space|10-100": ['@image(100x100, @color)']
			}
		})
	})
})


module.exports = data